<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <title>后台管理系统</title>

    <!--[if lt IE 8]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <link href="../static/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="../static/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="../static/css/animate.min.css" rel="stylesheet">
    <link href="../static/css/style.min.css?v=4.0.0" rel="stylesheet">
    <link href="../static/css/plugins/popup/popup.css" rel="stylesheet">
    <link href="../static/css/common.css" rel="stylesheet">
	<style>
		.add-box{
			width: 100%;
			max-width: 280px;
		}
		.add-box input{
		   margin-bottom: 20px;
		   text-align: left;
		   text-indent: 1em;
		   float: none;
		}
		.footer{
			text-align: center;
		}
		.pull-right{
			float: unset!important;
		}
	</style>
  </head>
  <body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
     <div id="wrapper">
       <!-- 左侧导航 start -->
        <nav class="navbar-default navbar-static-side" role="navigation">
          <div class="nav-close"><i class="fa fa-times-circle"></i></div>
          <div class="sidebar-collapse">
              <ul class="nav" id="side-menu">
                <!-- <li>
                    <a href="#">
                        <i class="fa fa-home"></i>
                        <span class="nav-label">账号管理</span>
                        <span class="fa arrow"></span>
                    </a>
                    <ul class="nav nav-second-level">
                        <li>
                            <a class="J_menuItem" href="./pages/manage/freeze.html" data-index="0">冻结/解冻账号</a>
                        </li>
                        <li>
                            <a class="J_menuItem" href="./pages/manage/relieve.html">开通/解除代理</a>
                        </li>
                        <li>
                            <a class="J_menuItem" href="./pages/manage/add.html">新增/删除账号</a>
                        </li>
                    </ul>
                </li>
                <li>
                    <a class="J_menuItem" href="./pages/operating-record/record.html"><i class="fa fa-edit"></i><span class="nav-label">操作记录</span></a>
                </li>
                <li>
                    <a class="J_menuItem" href="./pages/statistics/statistics.html"><i class="fa fa fa-bar-chart-o"></i><span class="nav-label">综合统计</span></a>
                </li>
                <li>
                    <a class="J_menuItem" href="./pages/present/present.html"><i class="fa fa-columns"></i> <span class="nav-label">系统赠送</span></a>
                </li>
                <li>
                    <a href="#">
                      <i class="fa fa-columns"></i>
                      <span class="nav-label">充值及消费记录</span>
                      <span class="fa arrow"></span>
                    </a>
                    <ul class="nav nav-second-level">
                        <li>
                            <a class="J_menuItem" href="./pages/record/recharge.html" data-index="0">充值记录</a>
                        </li>
                        <li>
                            <a class="J_menuItem" href="./pages/record/consume.html">消费记录</a>
                        </li>
                    </ul>
                </li>
                <li>
                    <a class="J_menuItem" href="./pages/discount/discount.html"><i class="fa fa-columns"></i> <span class="nav-label">充值优惠</span></a>
                </li>
                <li>
                    <a class="J_menuItem" href="./pages/recharge/recharge.html"><i class="fa fa-columns"></i> <span class="nav-label">代理充值</span></a>
                </li> -->
              </ul>
            </div>
        </nav>
        <!-- 左侧导航 end -->

        <!-- 右侧部分 start-->
        <div id="page-wrapper" class="gray-bg dashbard-1">
           <div class="row border-bottom">
              <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
                <div class="navbar-header"><a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a>
                    <form role="search" class="navbar-form-custom" method="post" action="search_results.html">
                        <div class="form-group">
                            <!-- <input type="text" placeholder="请输入您需要查找的内容 …" class="form-control" name="top-search" id="top-search"> -->
                        </div>
                    </form>
                </div>
				<a href="/login" class="roll-nav roll-right J_tabExit exit-btn"><i class="fa fa fa-sign-out"></i> 退出</a>
              </nav>
           </div>

           <div class="row content-tabs">
               <!-- <button class="roll-nav roll-left J_tabLeft"><i class="fa fa-backward"></i>
               </button> -->
               <nav class="page-tabs J_menuTabs">
                   <div class="page-tabs-content">
                       <a href="javascript:;" class="active J_menuTab" data-id="/index_v1">首页</a>
                   </div>
               </nav>
               <!-- <button class="roll-nav roll-right J_tabRight"><i class="fa fa-forward"></i>
               </button> -->
               <div class="btn-group roll-nav roll-right">
                   <button class="dropdown J_tabClose" data-toggle="dropdown">关闭操作<span class="caret"></span>

                   </button>
                   <ul role="menu" class="dropdown-menu dropdown-menu-right">
                       <!-- <li class="divider"></li> -->
                       <li class="J_tabCloseAll"><a>关闭全部选项卡</a>
                       </li>
                       <li class="J_tabCloseOther"><a>关闭其他选项卡</a>
                       </li>
                   </ul>
               </div>
               <a href="/login" class="roll-nav roll-right J_tabExit"><i class="fa fa fa-sign-out"></i> 退出</a>
           </div>

           <div class="row J_mainContent" id="content-main">
               <!-- <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="/index_v1" frameborder="0" data-id="index_v1.html" seamless></iframe> -->
			    <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="/index_v1" frameborder="0" data-id="/index_v1" seamless></iframe> 
			  
           </div>
           <div class="footer">
                <div class="pull-right">&copy; 2018-2019 <a href="#">逗徕互娱后台管理系统</a>
                </div>
            </div>

        </div>

        <!-- 右侧部分 end-->

     </div>

     <script src="../static/js/jquery.min.js?v=2.1.4"></script>
     <script src="../static/js/bootstrap.min.js?v=3.3.5"></script>
     <script src="../static/js/plugins/metisMenu/jquery.metisMenu.js"></script>
     <script src="../static/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
     <script src="../static/js/plugins/layer/layer.min.js"></script>
     <script src="../static/js/hplus.min.js?v=4.0.0"></script>
     <script type="text/javascript" src="../static/js/contabs.min.js?v=1.0.3"></script>
     <script src="../static/js/plugins/pace/pace.min.js"></script>
     <script src="../static/js/plugins/popup/popup.js"></script>
     <script src="../static/js/http.js"></script>
     <script type="text/javascript">
		 //menu对应的页面
		 var menuPage = {
			'账号管理':{
				'icon':'fa-home'
			},
			'冻结账号':{//冻结
				'url':'/gameUser/freeze'
			},
			'开通代理':{
				'url':'/gameUser/relieve'//开通代理
			},
			'管理员管理':{
				'url':'/system/user/add'//管理员管理
			},
			'修改密码':{
				'url':'/system/user/password'//修改密码
			},
			'操作记录':{
				'icon':'fa-edit'
			},
			'登录记录':{
				'url':'/doulai/operLog'//操作记录
			},
			'系统消息':{
				'icon':'fa-envelope'
			},
			'跑马灯':{
				'url':'/doulai/marquee'
			},
			'综合统计':{
				'icon':'fa-bar-chart-o',
				'url':'/doulai/playCount'//综合统计
			},
			'系统赠送':{
				'icon':'fa-magic'
			},
			'赠送金币/房卡':{
				'url':'/doulai/giveLog',
			},
			'充值及消费记录':{
				'icon':'fa-table'
			},
			'充值记录':{
				'url':'/doulai/chargeLog'
			},
			'消费记录':{
				'url':'/doulai/consumeLog'
			},
			'充值优惠':{
				'icon':'fa-cutlery'
			},
			'代理优惠':{
				'url':'/doulai/discount',
			},
			'基本信息':{
				'icon':'fa-envelope',
				'url':'/gameUser/mation'
			},
			'代理充值':{
				'icon':'fa-magic'
			},
			'充值':{
				'url':'/gameUser/recharge'
			},
			'统计':{
				'icon':'fa-bar-chart-o',
				'url':'/doulai/playCount/proxy'
			}
		 };
		 getMenu();

        //获取menu
        function getMenu(){
          _POST('/menu/getMenu',{},false).then(function(res){
			  console.log(res)
              var data = res.data;
              //处理列表
              for(var i in data){
                 var menuName = data[i].menuName;
                 var menuChildren = data[i].children;
                 if(menuChildren.length==0){//一层
                     var menuFirst = '<li>'+
                                         '<a class="J_menuItem" href='+ menuPage[menuName].url +'><i class="fa '+(menuPage[menuName].icon?menuPage[menuName].icon:"")+'"></i> <span class="nav-label">'+menuName+'</span></a>'+
                                     '</li>';
                     $('#side-menu').append(menuFirst)
                 }else{//循环子菜单
				    var menuChildrenHtml = '';
				    for(var j in menuChildren){
						menuChildrenHtml += '<li><a class="J_menuItem" href='+menuPage[menuChildren[j].menuName].url+' data-href='+menuPage[menuChildren[j].menuName].url+'>'+ menuChildren[j].menuName +'</a></li>'
					}
					var menuFirst = '<li>'+
					                    '<a href="#"><i class="fa '+(menuPage[menuName].icon?menuPage[menuName].icon:"")+'"></i> <span class="nav-label">'+menuName+'</span><span class="fa arrow"></span></a>'+
									    '<ul class="nav nav-second-level">'+ menuChildrenHtml +'</ul>'
					                '</li>';
				   $('#side-menu').metisMenu('dispose');
				   $('#side-menu').append(menuFirst);
				   $('#side-menu').metisMenu();
                 }
              }
			  $(".J_menuItem").each(function (t) {
					console.log(t)
					$(this).attr("data-index") || $(this).attr("data-index", t)
				})
          },function(fail){
             console.log('获取菜单失败')
          })
        }
//J_iframe
        // $(document).on('click','.J_menuItem',function(){
           // var src = $(this).data('href');
		   // $('.J_iframe').data('id',src);
           // $('.J_iframe').attr('src',src)
        // })
		
// 		$(document).on('click','.J_menuTab',function(){
// 			var src = $(this).data('id');
// 			$('.J_iframe').attr('src',src)
// 		})

        function addModal(callback){
           var formHtml = '<div class="add-box">'+
                              '<input class="input-user" placeholder="请输入管理员的登录名" />'+
							  '<input class="input-psw" placeholder="请输入管理员的登录密码" />'+
                          '</div>';
           popup.alert({
             title:'添加管理员',
             val:formHtml,
             sureCb:function(){
               var val = $.trim($('.input-user').val());
			   var pswVal = $.trim($('.input-psw').val());
               if(!val){
                 popup.tips('请输入管理员的登录名',1000);
				 return;
               }else if(!pswVal){
				 popup.tips('请输入管理员的登录密码',1000);
			     return;
			   }else if(pswVal.length<6){
				   popup.tips('请输入最少6位数的密码',1000);
				   return;
			   }else{
                 callback&&callback(val,pswVal);
               }
             }
           })
        }

        function closeModal(){
           popup.closeModal(".popup-closeModal");
        }
		function indexTips(msg){
		   popup.tips(msg,1000);
		}
		function toLogin(){
			window.location.replace('/login')
		}

		// 开通代理
		 function inputModal(callback){
			 var formHtml = '<div class="add-box">'+
													'<input class="input-user" placeholder="请输入该代理登录名" />'+
													'<input class="input-psw" placeholder="请输入该代理登录密码" />'+
											'</div>';
			 popup.alert({
				 title:'开通代理',
				 val:formHtml,
				 sureCb:function(){
					 var val = $.trim($('.input-user').val());
					 var pswVal = $.trim($('.input-psw').val())
					 if(!val){
						 popup.tips('请输入该代理登录名',1000);
						 return;
					 }else if(!pswVal){
						 popup.tips('请输入该代理登录密码',1000);
						 return;
					 }else if(pswVal.length<6){
						 popup.tips('最少设置6位数的密码',1000);
						 return;
					 }else{
						 callback&&callback(val,pswVal);
					 }
				 }
			 })
		}
		
		function inputModals(callback){
			 var formHtml = '<div class="add-box">'+
									'<input class="input-change" name="password" type="password" placeholder="请输入新密码" />'+
							'</div>';
			 popup.alert({
				 title:'重置密码',
				 val:formHtml,
				 sureCb:function(){
					 var val = $.trim($('.input-change').val());
					 if(!val){
						 popup.tips('请输入新密码',1000);
						 return;
					 }else if(val.length<6){
						 popup.tips('密码至少为6位',1000);
						 return;
					 }else{
						 callback&&callback(val);
					 }
				 }
			 })
		}
		

     </script>
  </body>
</html>
